package cc.yiueil.service;

import cc.yiueil.entity.UserEntity;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    public UserEntity getUserByUsernameAndPassword(String username, String password) {
        if (username.equals(password)) {
            return new UserEntity(username, password);
        }
        throw new UsernameNotFoundException(String.format("%s: 账号或者密码错误", username));
    }
}
